package com.hzlj.position.locate.common.dto.position;


import cn.hutool.core.bean.BeanUtil;
import com.fz.common.dict.annotation.Dict;
import com.hzlj.position.config.common.dto.common.PositionHandleExtDTO;
import com.hzlj.position.locate.common.common.PositionSimpleDTO;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 通信联络核查-核查-纠偏(ReportInspectionCorrect)查询结果返回DTO
 *
 * @author lifh
 * @date 2023-07-26 15:46:57
 */
@Data
@ToString
@Accessors(chain = true)
public class PositionCorrectDTO {
    /**
     * 纠偏配置ID(position_correct_config)
     */
    private String correctConfigId;
    /**
     * 被纠偏位置,json-PositionSimpleDTO
     */
    @Dict
    private PositionSimpleDTO correctOriginalPosition;
    /**
     * 上报位置，自动纠偏则为空,json-PositionSimpleDTO
     */
    @Dict
    private PositionSimpleDTO correctReportPosition;
    /**
     * 纠偏后的位置,json-PositionSimpleDTO
     */
    @Dict
    private PositionSimpleDTO correctPosition;
    /**
     * 上报位置-位置确认
     */
    @Dict
    private PositionSimpleDTO trackCheckReportPosition;
    /**
     * 纠偏时间
     */
    private Date handleTime;
    /**
     * 纠偏人信息
     */
    private PositionHandleExtDTO handleExt;

    public static PositionCorrectDTO from(PositionExtDTO positionExt) {
        if (positionExt == null) {
            return null;
        }
        return BeanUtil.copyProperties(positionExt, PositionCorrectDTO.class);
    }
}
